package com.zmx.common.common.config;

import org.apache.http.impl.client.CloseableHttpClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: HttpClient连接池
 * @ClassName: PoolHttpClientConfig
 * @Author zhaomxr
 * @Date 2021-11-30 15:56
 */
@Configuration
public class PoolHttpClientConfig {

    @Bean("httpClient")
    public CloseableHttpClient httpClient() {
        PoolHttpClientHelper.closeExpiredConnections();
        return PoolHttpClientHelper.getHttpclientPool();
    }
}
